3.31 \(\int \frac{d+e x}{(1+x^2+x^4)^2} \, dx\)

Optimal. Leaf size=140 \[ \frac{d x \left (1-x^2\right )}{6 \left (x^4+x^2+1\right )}-\frac{1}{4} d \log \left (x^2-x+1\right )+\frac{1}{4} d \log \left (x^2+x+1\right )-\frac{d \tan ^{-1}\left (\frac{1-2 x}{\sqrt{3}}\right )}{3 \sqrt{3}}+\frac{d \tan ^{-1}\left (\frac{2 x+1}{\sqrt{3}}\right )}{3 \sqrt{3}}+\frac{e \left (2 x^2+1\right )}{6 \left (x^4+x^2+1\right )}+\frac{2 e \tan ^{-1}\left (\frac{2 x^2+1}{\sqrt{3}}\right )}{3 \sqrt{3}} \]

[Out]

(d*x*(1 - x^2))/(6*(1 + x^2 + x^4)) + (e*(1 + 2*x^2))/(6*(1 + x^2 + x^4)) - (d*ArcTan[(1 - 2*x)/Sqrt[3]])/(3*S
qrt[3]) + (d*ArcTan[(1 + 2*x)/Sqrt[3]])/(3*Sqrt[3]) + (2*e*ArcTan[(1 + 2*x^2)/Sqrt[3]])/(3*Sqrt[3]) - (d*Log[1
 - x + x^2])/4 + (d*Log[1 + x + x^2])/4

________________________________________________________________________________________

Rubi [A]  time = 0.09779, antiderivative size = 140, normalized size of antiderivative = 1., number of steps used = 17, number of rules used = 10, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.625, Rules used = {1673, 12, 1092, 1169, 634, 618, 204, 628, 1107, 614} \[ \frac{d x \left (1-x^2\right )}{6 \left (x^4+x^2+1\right )}-\frac{1}{4} d \log \left (x^2-x+1\right )+\frac{1}{4} d \log \left (x^2+x+1\right )-\frac{d \tan ^{-1}\left (\frac{1-2 x}{\sqrt{3}}\right )}{3 \sqrt{3}}+\frac{d \tan ^{-1}\left (\frac{2 x+1}{\sqrt{3}}\right )}{3 \sqrt{3}}+\frac{e \left (2 x^2+1\right )}{6 \left (x^4+x^2+1\right )}+\frac{2 e \tan ^{-1}\left (\frac{2 x^2+1}{\sqrt{3}}\right )}{3 \sqrt{3}} \]

Antiderivative was successfully verified.

[In]

Int[(d + e*x)/(1 + x^2 + x^4)^2,x]

[Out]

(d*x*(1 - x^2))/(6*(1 + x^2 + x^4)) + (e*(1 + 2*x^2))/(6*(1 + x^2 + x^4)) - (d*ArcTan[(1 - 2*x)/Sqrt[3]])/(3*S
qrt[3]) + (d*ArcTan[(1 + 2*x)/Sqrt[3]])/(3*Sqrt[3]) + (2*e*ArcTan[(1 + 2*x^2)/Sqrt[3]])/(3*Sqrt[3]) - (d*Log[1
 - x + x^2])/4 + (d*Log[1 + x + x^2])/4

Rule 1673

Int[(Pq_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> Module[{q = Expon[Pq, x], k}, Int[Sum[Coeff[
Pq, x, 2*k]*x^(2*k), {k, 0, q/2}]*(a + b*x^2 + c*x^4)^p, x] + Int[x*Sum[Coeff[Pq, x, 2*k + 1]*x^(2*k), {k, 0,
(q - 1)/2}]*(a + b*x^2 + c*x^4)^p, x]] /; FreeQ[{a, b, c, p}, x] && PolyQ[Pq, x] &&  !PolyQ[Pq, x^2]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 1092

Int[((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> -Simp[(x*(b^2 - 2*a*c + b*c*x^2)*(a + b*x^2 + c*x^
4)^(p + 1))/(2*a*(p + 1)*(b^2 - 4*a*c)), x] + Dist[1/(2*a*(p + 1)*(b^2 - 4*a*c)), Int[(b^2 - 2*a*c + 2*(p + 1)
*(b^2 - 4*a*c) + b*c*(4*p + 7)*x^2)*(a + b*x^2 + c*x^4)^(p + 1), x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*
a*c, 0] && LtQ[p, -1] && IntegerQ[2*p]

Rule 1169

Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[a/c, 2]}, With[{r =
Rt[2*q - b/c, 2]}, Dist[1/(2*c*q*r), Int[(d*r - (d - e*q)*x)/(q - r*x + x^2), x], x] + Dist[1/(2*c*q*r), Int[(
d*r + (d - e*q)*x)/(q + r*x + x^2), x], x]]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2
- b*d*e + a*e^2, 0] && NegQ[b^2 - 4*a*c]

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 1107

Int[(x_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> Dist[1/2, Subst[Int[(a + b*x + c*x^2)^p, x],
 x, x^2], x] /; FreeQ[{a, b, c, p}, x]

Rule 614

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((b + 2*c*x)*(a + b*x + c*x^2)^(p + 1))/((p +
1)*(b^2 - 4*a*c)), x] - Dist[(2*c*(2*p + 3))/((p + 1)*(b^2 - 4*a*c)), Int[(a + b*x + c*x^2)^(p + 1), x], x] /;
 FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0] && LtQ[p, -1] && NeQ[p, -3/2] && IntegerQ[4*p]

Rubi steps

\begin{align*} \int \frac{d+e x}{\left (1+x^2+x^4\right )^2} \, dx &=\int \frac{d}{\left (1+x^2+x^4\right )^2} \, dx+\int \frac{e x}{\left (1+x^2+x^4\right )^2} \, dx\\ &=d \int \frac{1}{\left (1+x^2+x^4\right )^2} \, dx+e \int \frac{x}{\left (1+x^2+x^4\right )^2} \, dx\\ &=\frac{d x \left (1-x^2\right )}{6 \left (1+x^2+x^4\right )}+\frac{1}{6} d \int \frac{5-x^2}{1+x^2+x^4} \, dx+\frac{1}{2} e \operatorname{Subst}\left (\int \frac{1}{\left (1+x+x^2\right )^2} \, dx,x,x^2\right )\\ &=\frac{d x \left (1-x^2\right )}{6 \left (1+x^2+x^4\right )}+\frac{e \left (1+2 x^2\right )}{6 \left (1+x^2+x^4\right )}+\frac{1}{12} d \int \frac{5-6 x}{1-x+x^2} \, dx+\frac{1}{12} d \int \frac{5+6 x}{1+x+x^2} \, dx+\frac{1}{3} e \operatorname{Subst}\left (\int \frac{1}{1+x+x^2} \, dx,x,x^2\right )\\ &=\frac{d x \left (1-x^2\right )}{6 \left (1+x^2+x^4\right )}+\frac{e \left (1+2 x^2\right )}{6 \left (1+x^2+x^4\right )}+\frac{1}{6} d \int \frac{1}{1-x+x^2} \, dx+\frac{1}{6} d \int \frac{1}{1+x+x^2} \, dx-\frac{1}{4} d \int \frac{-1+2 x}{1-x+x^2} \, dx+\frac{1}{4} d \int \frac{1+2 x}{1+x+x^2} \, dx-\frac{1}{3} (2 e) \operatorname{Subst}\left (\int \frac{1}{-3-x^2} \, dx,x,1+2 x^2\right )\\ &=\frac{d x \left (1-x^2\right )}{6 \left (1+x^2+x^4\right )}+\frac{e \left (1+2 x^2\right )}{6 \left (1+x^2+x^4\right )}+\frac{2 e \tan ^{-1}\left (\frac{1+2 x^2}{\sqrt{3}}\right )}{3 \sqrt{3}}-\frac{1}{4} d \log \left (1-x+x^2\right )+\frac{1}{4} d \log \left (1+x+x^2\right )-\frac{1}{3} d \operatorname{Subst}\left (\int \frac{1}{-3-x^2} \, dx,x,-1+2 x\right )-\frac{1}{3} d \operatorname{Subst}\left (\int \frac{1}{-3-x^2} \, dx,x,1+2 x\right )\\ &=\frac{d x \left (1-x^2\right )}{6 \left (1+x^2+x^4\right )}+\frac{e \left (1+2 x^2\right )}{6 \left (1+x^2+x^4\right )}-\frac{d \tan ^{-1}\left (\frac{1-2 x}{\sqrt{3}}\right )}{3 \sqrt{3}}+\frac{d \tan ^{-1}\left (\frac{1+2 x}{\sqrt{3}}\right )}{3 \sqrt{3}}+\frac{2 e \tan ^{-1}\left (\frac{1+2 x^2}{\sqrt{3}}\right )}{3 \sqrt{3}}-\frac{1}{4} d \log \left (1-x+x^2\right )+\frac{1}{4} d \log \left (1+x+x^2\right )\\ \end{align*}

Mathematica [C]  time = 0.494046, size = 146, normalized size = 1.04 \[ \frac{d \left (x-x^3\right )+2 e x^2+e}{6 \left (x^4+x^2+1\right )}-\frac{\left (\sqrt{3}-11 i\right ) d \tan ^{-1}\left (\frac{1}{2} \left (\sqrt{3}-i\right ) x\right )}{6 \sqrt{6+6 i \sqrt{3}}}-\frac{\left (\sqrt{3}+11 i\right ) d \tan ^{-1}\left (\frac{1}{2} \left (\sqrt{3}+i\right ) x\right )}{6 \sqrt{6-6 i \sqrt{3}}}-\frac{2 e \tan ^{-1}\left (\frac{\sqrt{3}}{2 x^2+1}\right )}{3 \sqrt{3}} \]

Warning: Unable to verify antiderivative.

[In]

Integrate[(d + e*x)/(1 + x^2 + x^4)^2,x]

[Out]

(e + 2*e*x^2 + d*(x - x^3))/(6*(1 + x^2 + x^4)) - ((-11*I + Sqrt[3])*d*ArcTan[((-I + Sqrt[3])*x)/2])/(6*Sqrt[6
 + (6*I)*Sqrt[3]]) - ((11*I + Sqrt[3])*d*ArcTan[((I + Sqrt[3])*x)/2])/(6*Sqrt[6 - (6*I)*Sqrt[3]]) - (2*e*ArcTa
n[Sqrt[3]/(1 + 2*x^2)])/(3*Sqrt[3])

________________________________________________________________________________________

Maple [A]  time = 0.02, size = 146, normalized size = 1. \begin{align*}{\frac{1}{4\,{x}^{2}+4\,x+4} \left ( \left ( -{\frac{d}{3}}-{\frac{e}{3}} \right ) x-{\frac{2\,d}{3}}+{\frac{e}{3}} \right ) }+{\frac{d\ln \left ({x}^{2}+x+1 \right ) }{4}}+{\frac{d\sqrt{3}}{9}\arctan \left ({\frac{ \left ( 1+2\,x \right ) \sqrt{3}}{3}} \right ) }-{\frac{2\,\sqrt{3}e}{9}\arctan \left ({\frac{ \left ( 1+2\,x \right ) \sqrt{3}}{3}} \right ) }-{\frac{1}{4\,{x}^{2}-4\,x+4} \left ( \left ({\frac{d}{3}}-{\frac{e}{3}} \right ) x-{\frac{2\,d}{3}}-{\frac{e}{3}} \right ) }-{\frac{d\ln \left ({x}^{2}-x+1 \right ) }{4}}+{\frac{d\sqrt{3}}{9}\arctan \left ({\frac{ \left ( 2\,x-1 \right ) \sqrt{3}}{3}} \right ) }+{\frac{2\,\sqrt{3}e}{9}\arctan \left ({\frac{ \left ( 2\,x-1 \right ) \sqrt{3}}{3}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x+d)/(x^4+x^2+1)^2,x)

[Out]

1/4*((-1/3*d-1/3*e)*x-2/3*d+1/3*e)/(x^2+x+1)+1/4*d*ln(x^2+x+1)+1/9*d*arctan(1/3*(1+2*x)*3^(1/2))*3^(1/2)-2/9*3
^(1/2)*arctan(1/3*(1+2*x)*3^(1/2))*e-1/4*((1/3*d-1/3*e)*x-2/3*d-1/3*e)/(x^2-x+1)-1/4*d*ln(x^2-x+1)+1/9*3^(1/2)
*arctan(1/3*(2*x-1)*3^(1/2))*d+2/9*3^(1/2)*arctan(1/3*(2*x-1)*3^(1/2))*e

________________________________________________________________________________________

Maxima [A]  time = 1.43411, size = 130, normalized size = 0.93 \begin{align*} \frac{1}{9} \, \sqrt{3}{\left (d - 2 \, e\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x + 1\right )}\right ) + \frac{1}{9} \, \sqrt{3}{\left (d + 2 \, e\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x - 1\right )}\right ) + \frac{1}{4} \, d \log \left (x^{2} + x + 1\right ) - \frac{1}{4} \, d \log \left (x^{2} - x + 1\right ) - \frac{d x^{3} - 2 \, e x^{2} - d x - e}{6 \,{\left (x^{4} + x^{2} + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)/(x^4+x^2+1)^2,x, algorithm="maxima")

[Out]

1/9*sqrt(3)*(d - 2*e)*arctan(1/3*sqrt(3)*(2*x + 1)) + 1/9*sqrt(3)*(d + 2*e)*arctan(1/3*sqrt(3)*(2*x - 1)) + 1/
4*d*log(x^2 + x + 1) - 1/4*d*log(x^2 - x + 1) - 1/6*(d*x^3 - 2*e*x^2 - d*x - e)/(x^4 + x^2 + 1)

________________________________________________________________________________________

Fricas [A]  time = 1.58244, size = 416, normalized size = 2.97 \begin{align*} -\frac{6 \, d x^{3} - 12 \, e x^{2} - 4 \, \sqrt{3}{\left ({\left (d - 2 \, e\right )} x^{4} +{\left (d - 2 \, e\right )} x^{2} + d - 2 \, e\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x + 1\right )}\right ) - 4 \, \sqrt{3}{\left ({\left (d + 2 \, e\right )} x^{4} +{\left (d + 2 \, e\right )} x^{2} + d + 2 \, e\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x - 1\right )}\right ) - 6 \, d x - 9 \,{\left (d x^{4} + d x^{2} + d\right )} \log \left (x^{2} + x + 1\right ) + 9 \,{\left (d x^{4} + d x^{2} + d\right )} \log \left (x^{2} - x + 1\right ) - 6 \, e}{36 \,{\left (x^{4} + x^{2} + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)/(x^4+x^2+1)^2,x, algorithm="fricas")

[Out]

-1/36*(6*d*x^3 - 12*e*x^2 - 4*sqrt(3)*((d - 2*e)*x^4 + (d - 2*e)*x^2 + d - 2*e)*arctan(1/3*sqrt(3)*(2*x + 1))
- 4*sqrt(3)*((d + 2*e)*x^4 + (d + 2*e)*x^2 + d + 2*e)*arctan(1/3*sqrt(3)*(2*x - 1)) - 6*d*x - 9*(d*x^4 + d*x^2
 + d)*log(x^2 + x + 1) + 9*(d*x^4 + d*x^2 + d)*log(x^2 - x + 1) - 6*e)/(x^4 + x^2 + 1)

________________________________________________________________________________________

Sympy [C]  time = 2.77069, size = 952, normalized size = 6.8 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)/(x**4+x**2+1)**2,x)

[Out]

(-d/4 - sqrt(3)*I*(d + 2*e)/18)*log(x + (-10309*d**4*e + 1026*d**4*(-d/4 - sqrt(3)*I*(d + 2*e)/18) - 7200*d**2
*e**3 - 31536*d**2*e**2*(-d/4 - sqrt(3)*I*(d + 2*e)/18) + 108432*d**2*e*(-d/4 - sqrt(3)*I*(d + 2*e)/18)**2 + 1
63296*d**2*(-d/4 - sqrt(3)*I*(d + 2*e)/18)**3 + 1792*e**5 + 11520*e**4*(-d/4 - sqrt(3)*I*(d + 2*e)/18) + 48384
*e**3*(-d/4 - sqrt(3)*I*(d + 2*e)/18)**2 + 311040*e**2*(-d/4 - sqrt(3)*I*(d + 2*e)/18)**3)/(3348*d**5 - 11408*
d**3*e**2 - 7936*d*e**4)) + (-d/4 + sqrt(3)*I*(d + 2*e)/18)*log(x + (-10309*d**4*e + 1026*d**4*(-d/4 + sqrt(3)
*I*(d + 2*e)/18) - 7200*d**2*e**3 - 31536*d**2*e**2*(-d/4 + sqrt(3)*I*(d + 2*e)/18) + 108432*d**2*e*(-d/4 + sq
rt(3)*I*(d + 2*e)/18)**2 + 163296*d**2*(-d/4 + sqrt(3)*I*(d + 2*e)/18)**3 + 1792*e**5 + 11520*e**4*(-d/4 + sqr
t(3)*I*(d + 2*e)/18) + 48384*e**3*(-d/4 + sqrt(3)*I*(d + 2*e)/18)**2 + 311040*e**2*(-d/4 + sqrt(3)*I*(d + 2*e)
/18)**3)/(3348*d**5 - 11408*d**3*e**2 - 7936*d*e**4)) + (d/4 - sqrt(3)*I*(d - 2*e)/18)*log(x + (-10309*d**4*e
+ 1026*d**4*(d/4 - sqrt(3)*I*(d - 2*e)/18) - 7200*d**2*e**3 - 31536*d**2*e**2*(d/4 - sqrt(3)*I*(d - 2*e)/18) +
 108432*d**2*e*(d/4 - sqrt(3)*I*(d - 2*e)/18)**2 + 163296*d**2*(d/4 - sqrt(3)*I*(d - 2*e)/18)**3 + 1792*e**5 +
 11520*e**4*(d/4 - sqrt(3)*I*(d - 2*e)/18) + 48384*e**3*(d/4 - sqrt(3)*I*(d - 2*e)/18)**2 + 311040*e**2*(d/4 -
 sqrt(3)*I*(d - 2*e)/18)**3)/(3348*d**5 - 11408*d**3*e**2 - 7936*d*e**4)) + (d/4 + sqrt(3)*I*(d - 2*e)/18)*log
(x + (-10309*d**4*e + 1026*d**4*(d/4 + sqrt(3)*I*(d - 2*e)/18) - 7200*d**2*e**3 - 31536*d**2*e**2*(d/4 + sqrt(
3)*I*(d - 2*e)/18) + 108432*d**2*e*(d/4 + sqrt(3)*I*(d - 2*e)/18)**2 + 163296*d**2*(d/4 + sqrt(3)*I*(d - 2*e)/
18)**3 + 1792*e**5 + 11520*e**4*(d/4 + sqrt(3)*I*(d - 2*e)/18) + 48384*e**3*(d/4 + sqrt(3)*I*(d - 2*e)/18)**2
+ 311040*e**2*(d/4 + sqrt(3)*I*(d - 2*e)/18)**3)/(3348*d**5 - 11408*d**3*e**2 - 7936*d*e**4)) - (d*x**3 - d*x
- 2*e*x**2 - e)/(6*x**4 + 6*x**2 + 6)

________________________________________________________________________________________

Giac [A]  time = 1.09115, size = 135, normalized size = 0.96 \begin{align*} \frac{1}{9} \, \sqrt{3}{\left (d - 2 \, e\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x + 1\right )}\right ) + \frac{1}{9} \, \sqrt{3}{\left (d + 2 \, e\right )} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, x - 1\right )}\right ) + \frac{1}{4} \, d \log \left (x^{2} + x + 1\right ) - \frac{1}{4} \, d \log \left (x^{2} - x + 1\right ) - \frac{d x^{3} - 2 \, x^{2} e - d x - e}{6 \,{\left (x^{4} + x^{2} + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)/(x^4+x^2+1)^2,x, algorithm="giac")

[Out]

1/9*sqrt(3)*(d - 2*e)*arctan(1/3*sqrt(3)*(2*x + 1)) + 1/9*sqrt(3)*(d + 2*e)*arctan(1/3*sqrt(3)*(2*x - 1)) + 1/
4*d*log(x^2 + x + 1) - 1/4*d*log(x^2 - x + 1) - 1/6*(d*x^3 - 2*x^2*e - d*x - e)/(x^4 + x^2 + 1)